package com.web;

import com.pojo.dto.Message;
import com.pojo.vo.CFishingShopVo;
import com.service.CFishingShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CFishingShopController {
    @Autowired
    CFishingShopService cFishingShopService;

    @RequestMapping(value = "/cfishingshops", method = RequestMethod.POST)
    public Message<List<CFishingShopVo>> findList(CFishingShopVo cFishingShopVo) {
        return cFishingShopService.list(cFishingShopVo);
    }

    @RequestMapping(value = "/cfishingshops/selectone", method = RequestMethod.POST)
    public Message<CFishingShopVo> find(Long id) {
        return cFishingShopService.selectOne(id);
    }

    @RequestMapping(value = "/cfishingshops/add", method = RequestMethod.POST)
    public Message<CFishingShopVo> add(CFishingShopVo cFishingShopVo) {
        return cFishingShopService.add(cFishingShopVo);
    }

    @RequestMapping(value = "/cfishingshops/update", method = RequestMethod.POST)
    public Message<CFishingShopVo> update(CFishingShopVo cFishingShopVo) {
        return cFishingShopService.edit(cFishingShopVo);
    }

    @RequestMapping(value = "/cfishingshops/delete/{id}", method = RequestMethod.POST)
    public Message<CFishingShopVo> delete(@PathVariable Long id) {
        return cFishingShopService.delete(id);
    }

}
